import { Component } from 'react'
import observe from '../utils/observe'
class Child2 extends Component {
    constructor(props) {
        super()
        this.state = {
            title: '你是个麻瓜'
        }
    }
    render() {
        return (<div>
            这是组件2
            <button onClick={
                () => {
                    observe.dispatch(this.state.title)
                }
            }>点击</button>
        </div>)
    }
}

export default Child2